package com.example.ljw.frescowallpaper.view;

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.example.ljw.frescowallpaper.R;

public class SettingActivity extends AppCompatActivity {
    private Button about_Btn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);

        initView();
        showaDialog();
    }

    private void showaDialog() {
        about_Btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                AlertDialog.Builder builder = new AlertDialog.Builder(SettingActivity.this);
                builder.setTitle("问题");
                builder.setMessage("李建伟他妈的帅不帅");
                builder.setIcon(R.mipmap.teemo);
                builder.setPositiveButton("很帅", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        Toast.makeText(SettingActivity.this, "MDZZ", Toast.LENGTH_SHORT).show();
                    }
                });
                builder.setNegativeButton("帅到爆炸", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        Toast.makeText(SettingActivity.this, "还口以", Toast.LENGTH_SHORT).show();
                    }
                });
                builder.create().show();
            }
        });
    }

    private void initView() {
        about_Btn = (Button) findViewById(R.id.about_btn);

    }
}
